/**
 * This code is part of the Bumpslide Library by David Knape
 * http://bumpslide.com/
 * 
 * Copyright (c) 2006, 2007, 2008 by Bumpslide, Inc.
 * 
 * Released under the open-source MIT license.
 * http://www.opensource.org/licenses/mit-license.php
 * see LICENSE.txt for full license terms
 */
 package {
	import com.bumpslide.ui.Applet;
	import com.bumpslide.ui.Panel;
	
	import flash.display.Loader;
	import flash.net.URLRequest;		

	/**
	 * Barebones Panel Test - content is unare of the panel
	 * 
	 * @mxmlc -sp+=../../classes -debug=true
	 * @author David Knape
	 */
	public class Demo_01_Panel extends Applet {

		private var panel:Panel;
		private var image:Loader;

		override protected function addChildren():void {
			
			// create panel with x=10, y=10
			panel = new Panel();
			panel.move(10, 10);
			
			// load an image
			image = new Loader();
			image.load(new URLRequest('http://farm4.static.flickr.com/3053/2572693685_c5a3718e05.jpg'));
			
			// put the image in the panel
			panel.content = image;
			
			// show the panel
			addChild(panel);			
		}

		// on stage resize, update the panel size
		override protected function draw():void {
			panel.setSize(width - 20, height - 20);
			super.draw();			
		}
	}
}
